/* ************************************************************************



************************************************************************ */

qx.Class.define("HersPOS.SalesTable",
{
  extend : qx.ui.table.Table,

  construct : function()
  {
    //     var windowManager = new qx.ui.window.Manager();
    this.base(arguments);
    var totals_url = "/HersPOS/default/get_totals.json";

    //   this.setLayout(new qx.ui.layout.Grid())
    //     this.table_win = new HersPOS.Table();
    this.setDecorator(null);
    this.setStatusBarVisible(false);
    this.totals_model = new qx.data.store.Json(totals_url);

    //   default_font= new qx.bom.Font(28, ["Verdana", "sans-serif"])dd
    //     this.setDecorator(null);
    //   this.add(this.createTable(),{flex : 0})
    //     this.add(this,1);
    this.remoteDataModel = new HersPOS.RemoteTableModel();
    this.setTableModel(this.remoteDataModel);

    //     this.footerModel = new qx.ui.table.model.Simple();
    //
    //     this.footerModel.setColumns([ "", "", "", "", "Totals :", 100, 1000, 2000 ],
    //     [ "id", "Product Name", "Date", "Time", "Price", "Items Sold", "Price", "Profit" ]);
    //
    this.footer = new qx.ui.table.Table(this.footerModel);
    this.footer.setHeight(1);
    this.footer.setStatusBarVisible(false);
    this.footer.setDecorator(null);
  },

  //     this._addSeparator("separator-vertical")
  //     this._add(this.footer,{flex : 0})
  //     this.table_win.open();
  members :
  {
    /**
     * TODOC
     *
     * @param value {var} TODOC
     * @return {void}
     */
    apply_param : function(value)
    {
//       console.log("applying " + value)
      param = "?query=" + value
      this.remoteDataModel.setParam(param);
      this.remoteDataModel.reloadData();

    },


    /**
     * TODOC
     *
     * @return {void}
     */
    reload_model : function() {
      this.remoteDataModel.reloadData();
    }
  },

  events : { "reload" : "qx.event.type.Event" }
});
